package com.wangzifan.controller;

import com.wangzifan.entity.Result;
import com.wangzifan.entity.User;
import com.wangzifan.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @Autowired
    private UserService userService;

    @PutMapping("/User")
    public Result updateUser(@RequestBody User user) {
        userService.updateUser(user);
        return Result.success(user);
    }
}
